class Solution(object):
    def hIndex(self, citations):
        """
        :type citations: List[int]
        :rtype: int
        """
        citaDict = {}
        for cita in citations:
            if cita not in citaDict:
                citaDict.update({cita:0})
            citaDict[cita]+=1
        citaList = list(citaDict.keys())
        citaList.sort(reverse=True)
        paper = 0
        h = 0
        for cita in citaList:
            paper += citaDict[cita]
            h = max(h, min(cita, paper))
        return h

print(Solution().hIndex([100]))